<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/WEB-INF/struts-tags.tld" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link id="favicon" href="/jxgl/favicon.ico" rel="icon" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>编辑学员</title>
<link rel="stylesheet" href="/jxgl/css/all.css" />
<link rel="stylesheet" href="/jxgl/css/login.css" />
<script type="text/javascript" src="/jxgl/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="/jxgl/js/jquery.validate.min.js"></script>
<script type="text/javascript" src="/jxgl/js/idvalidate.js"></script>
<script language="javascript" type="application/javascript">
	$(document).ready(function(){
		$.validator.setDefaults({       
			submitHandler: function(form) {    
				form.submit();    
			}
		});
		jQuery.validator.addMethod("stringCheck", function(value, element) {       
			return this.optional(element) || /^[\u0391-\uFFE5\w]+$/.test(value);       
		}, "只能包括中文字、英文字母、数字和下划线");
		jQuery.validator.addMethod("engCheck", function(value, element) {       
			return this.optional(element) || /^[\w]+$/.test(value);       
		}, "只能包括英文字母、数字和下划线");
		jQuery.validator.addMethod("chnCheck", function(value, element) {       
			return this.optional(element) || /^[\u0391-\uFFE5]+$/.test(value);       
		}, "只能包括中文字");
		jQuery.validator.addMethod("numCheck", function(value, element) {       
			return this.optional(element) || /^\d+$/.test(value);       
		}, "只能包括数字");
		jQuery.validator.addMethod("byteRangeLength", function(value, element, param) {       
			var length = value.length;
			for(var i = 0; i < value.length; i++){       
				if(value.charCodeAt(i) > 127){       
				length++;
				}       
			}
			return this.optional(element) || ( length >= param[0] && length <= param[1] );       
		}, "请确保输入的值在3-15个字节之间(一个中文字算2个字节)");
		jQuery.validator.addMethod("isIdCardNo", function(value, element) {       
			return this.optional(element) || IdCardValidate(value);       
		}, "请正确输入您的身份证号码");
		jQuery.validator.addMethod("isMobile", function(value, element) {       
			var length = value.length;   
			var mobile = /^(((13[0-9]{1})|(15[0-9]{1})|(18[02356789]{1}))+\d{8})$/;   
			return this.optional(element) || (length == 11 && mobile.test(value));       
		}, "请正确填写您的手机号码");	
		jQuery.validator.addMethod("isGoodAge", function(value, element) {
			var age = /^\d{1,2}$/;   
			return this.optional(element) || age.test(value);       
		}, "请正确填写年龄");
		$('#submitForm').validate({
			rules:{
				realName:{
					required:true,
					chnCheck:true,
					byteRangeLength:[4,8]
				},			
				idcard:{
					required:true,
					isIdCardNo:true
				},
				age:{
					required:true,
					isGoodAge:true
				},
				address:{
					required:true,
					byteRangeLength:[3,20]
				},
				phone:{
					required:true,
					isMobile:true
				}				
			},
			messages:{
				realName:{
					required:'请填写姓名',
					chnCheck:'只能包含中文字符',
					byteRangeLength:'字符数目在2-4'				
				},
				idcard:{
					required:'请输入身份证号码',
					isIdCardNo:'违规身份证号'
				},
				age:{
					required:'请输入年龄',
					isGoodAge:'请输入合适的年龄'
				},
				address:{
					required:'请输入地址',
					byteRangeLength:'字符数目不超过20'
				},
				phone:{
					required:'请输入手机',
					isMobile:'手机号码格式不正确'
				}
			},
			focusInvalid: false,
			onkeyup: false,
			errorPlacement:function(error,element){
				error.appendTo(element.parent());
			}
		});
	});
</script>

</head>
<body id="lg_body">
<div id="lg_wrap">
<div id="ln_header">
			<div class="header_logo_bg">
				<div class="header_link"> 
						<a target="_blank" href="http://www.changdajx.cn/%E8%81%94%E7%B3%BB%E6%88%91%E4%BB%AC/"
						class="help_icon">问题咨询</a>&nbsp;&nbsp; 
						<a target="_blank"
						href="http://www.changdajx.cn"
						class="home_icon">驾校首页</a>&nbsp;&nbsp;
				</div>
			</div>
		</div>
		<div class="main_link" style="width:960px;margin-top:3px;">
			<a href="/jxgl/login"><b>首页</b></a> &gt; <font color="#666666">管理员</font>
		</div>
		<div id="ln_main" style="height:590px;width:960px;">
			<div id="left-column">
                <div class="widget-alt">
                    <div class="headline no-margin"><h4>个人工具箱</h4></div>
                        <ul class="links-list-alt" style="padding-left:0px">
                            <li><a href="/jxgl/admin/editPwd">修改密码</a></li>
							<li><a href="/jxgl/admin/newdriver.jsp">新建教练</a></li>
							<li><a href="/jxgl/admin/listdriver">教练列表</a></li>
							<li><a href="/jxgl/admin/liststudent">学员列表</a></li>
							<li><a href="/jxgl/logout">退出登录</a></li>
                        </ul>
                </div>
            </div>
            <div id="center-column">
            <div class="headline no-margin"><h4>修改学员信息</h4></div>
        <s:if test="msg != null">
            <div class="notification success closeable" id="notification_1" style="display: block;">
			<p><span>提示!</span> <s:property value="msg"/></p></div>
		</s:if>
				<form action="/jxgl/admin/editStudent" method="POST" id="submitForm">
						<input type="hidden" name="id" value="<s:property value="student.id"/>" />
                    	<div class="user_login_table" style="height:570px;width:100%">
                    	<div class="username">
                            <div class="login_name">
                                用户名:
                            </div>
                            <div>
                                <input type="text" tabindex="1" disabled class="input_box" id="username" name="username" value="<s:property value="student.name"/>">
                            </div>
                        </div>          
                        <div class="username">
                            <div class="login_name">
                                真实姓名:
                            </div>
                            <div>
                                <input type="text" tabindex="1"  class="input_box" id="realName" name="realName" value="<s:property value="student.realName"/>">
                            </div>
                        </div>
<!--                         <div class="username"> -->
<!--                             <div class="login_name"> -->
<!--                                 身份证号: -->
<!--                             </div> -->
<!--                             <div> -->
<%--                                 <input type="text" tabindex="1"  class="input_box" id="idcard" name="idcard" value="<s:property value="student.idcard"/>"> --%>
<!--                             </div> -->
<!--                         </div> -->
                        <div class="username">
                            <div class="login_name">
                                驾车类型:
                            </div>
                            <div style="padding-top:5px">
                                <input type="radio" tabindex="1" id="carType" name="carType" value="0" <s:if test="student.carType==0">checked</s:if>>手动
                                <input type="radio" tabindex="1" id="carType" name="carType" value="1" style="padding-left:50px" <s:if test="student.carType==1">checked</s:if>>自动
                            </div>
                        </div>
                        <div class="username">
                            <div class="login_name">
                                年龄:
                            </div>
                            <div>
                                <input type="text" tabindex="1" class="input_box" id="age" name="age" value="<s:property value="student.age"/>">
                            </div>
                        </div>
<!--                         <div class="username"> -->
<!--                             <div class="login_name"> -->
<!--                                 性别: -->
<!--                             </div> -->
<!--                             <div style="padding-top:5px"> -->
<!--                                 <input type="radio" tabindex="1" id="gender" name="gender" value="0" <s:if test="student.gender==0">checked</s:if>>男 -->
<!--                                 <input type="radio" tabindex="1" id="gender" name="gender" value="1" style="padding-left:50px" <s:if test="student.gender==1">checked</s:if>>女 -->
<!--                             </div> -->
<!--                         </div> -->
                        <div class="username">
                            <div class="login_name">
                                接送地址:
                            </div>
                            <div>
                                <input type="text" tabindex="1" class="input_box" id="address" name="address" value="<s:property value="student.address"/>">
                            </div>
                        </div>
                                                <div class="username">
                            <div class="login_name">
                                手机号码:
                            </div>
                            <div>
                                <input type="text" tabindex="1" class="input_box" id="phone" name="phone" value="<s:property value="student.phone"/>">
                            </div>
                        </div>
                        <div class="login_btn">                        	
							<input name="save" type="submit" value="保存" class="login_btn_style">
						</div>
					</div>
					</form>
					</div>

        </div>
</div>
</body>
</html>